#ifndef DOWNLOAD_H
#define DOWNLOAD_H

#include <QWidget>
#include <QProgressBar>
#include <QToolButton>
#include <QDebug>
#include <QFileDialog>
#include <QMessageBox>
#include <mylog.h>
#include <QObject>
#include <mynetworkaccessmanager.h>
#include <mysettings.h>
#include <QHBoxLayout>
#include <QLabel>

class Download : public QWidget
{
    Q_OBJECT
public:
    explicit Download(QWidget *parent = 0);
    ~Download();
    void setAccessManager(myNetworkAccessManager*);
    int savePath(const QUrl&);
    void DownloadFile();
public slots:
    void stop();
    void OpenFile();
protected slots:
    void downloadFinished();
    void progress(qint64,qint64);
private:
    MySettings* settings;
    QProgressBar* m_progressbar;
    QLabel* m_text;
    QNetworkReply* m_reply;
    myNetworkAccessManager* m_accessmanager;
    QToolButton* m_button;
    QString* m_filename;
    QByteArray* m_file;
    QHBoxLayout* m_layout;
    QUrl* m_url;
};

#endif // DOWNLOAD_H
